import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

public class Test {


    public static void main(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);


        System.out.println(myQueue.poll());


    }





    public static void main3(String[] args) {
        Queue<Integer> queue1 = new LinkedList<>();
        Queue<Integer> queue2 = new LinkedList<>();

        queue1.offer(1);
        queue1.offer(2);
        queue1.offer(3);
        queue1.offer(4);
        System.out.println(queue1);


        System.out.println(queue1.poll());
        System.out.println(queue1.poll());

        System.out.println(queue1);
    }



















    public boolean IsPopOrder (int[] pushA, int[] popA) {
        Stack<Integer> stack = new Stack<>();
        int j=0;
        for(int i=0;i<pushA.length;i++){
            stack.push(pushA[i]);
            while (!stack.empty() &&j<popA.length && stack.peek() == popA[j]){
                stack.pop();
                j++;
            }

        }
        return stack.empty();

    }


    public static void main2(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        myStack.push(4);




//        System.out.println(myStack.peek());
//        System.out.println(myStack.peek());
//        System.out.println(myStack.peek());
//        System.out.println(myStack.pop());
//        System.out.println(myStack.pop());
//        System.out.println(myStack.pop());
//        System.out.println(myStack.pop());




    }






    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        System.out.println(stack.pop());

    }




}
